package com.example.basic.web.model.dataCode;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.basic.base.IdEntity;
import com.example.basic.base.event.PreCreateEventEntity;
import com.example.basic.base.event.PreUpdateEventEntity;
import com.example.basic.utils.CommonConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * <p>
 * 系统数据代码表
 * </p>
 *
 * @author wjq
 * @since 2024-02-29
 */
@TableName("sys_data_code")
@Data
@ApiModel(value="DataCode对象", description="系统数据代码表")
public class DataCode extends IdEntity implements PreCreateEventEntity, PreUpdateEventEntity {

    @ApiModelProperty(value = "主键ID")
    @TableId("id")
    private String id;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_at", fill = FieldFill.INSERT)
    @JSONField(format = CommonConstant.TIME_FORMAT_EIGHTEEN)
    private Date createAt;

    @ApiModelProperty(value = "创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "update_at", fill = FieldFill.UPDATE)
    @JSONField(format = CommonConstant.TIME_FORMAT_EIGHTEEN)
    private Date updateAt;

    @ApiModelProperty(value = "修改人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty(value = "代码名称")
    @TableField("data_code_name")
    private String dataCodeName;

    @ApiModelProperty(value = "当前代码")
    @TableField("data_code_no")
    private Long dataCodeNo;

    @ApiModelProperty(value = "当前代码长度")
    @TableField("data_code_len")
    private Long dataCodeLen;

    @ApiModelProperty(value = "代码前缀-字符")
    @TableField("data_code_head")
    private String dataCodeHead;

    @ApiModelProperty(value = "代码前缀-年份")
    @TableField("data_code_year")
    private String dataCodeYear;

    @ApiModelProperty(value = "代码前缀-年份格式")
    @TableField("data_code_year_format")
    private String dataCodeYearFormat;

    @ApiModelProperty(value = "获取当前最大代码")
    @TableField("max_data_code_no")
    private String maxDataCodeNo;


}